home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="UTF-8"?> <!--Render fields for electronic communications--> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" /> <xsl:template match="/"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <xsl:for-each select="OpenContacts/Contacts/Contact"> <table border="0" width="100%" id="table2"> <tr> <td width="80%"> <font face="Times New Roman" size="3"> <b> <xsl:value-of select="@Name"/> </b> </font> </td> </tr> </table> <xsl:if test="count(Sections/Section/Fields/Field[contains(@Name, 'Email')]) > 0"> <div style="margin-left: 15px;"> <b> <font face="Times New Roman" size="2"> Email </font> </b> </div> <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0"> <xsl:for-each select="Sections/Section/Fields/Field[contains(@Name, 'Email')]"> <tr> <td width="15"></td> <td width="80" bgcolor="#C3D9FF"> <b> <font face="Times New Roman" size="2"> <xsl:value-of select="../../@Name"/> </font> </b> </td> <td bgcolor="#E0ECFF"> <font size="3"> <xsl:choose> <xsl:when test="contains(@Name, 'Primary')"> <b> <a href="mailto:{@Value}"> <xsl:value-of select="@Value"/> </a> </b> </xsl:when> <xsl:otherwise> <a href="mailto:{@Value}"> <xsl:value-of select="@Value"/> </a> </xsl:otherwise> </xsl:choose> </font> </td> </tr> </xsl:for-each> </table> </xsl:if> <xsl:if test="count(Sections/Section/Fields/Field[contains('Mobile Phone Phone2 Phone3', @Name)]) > 0"> <div style="margin-left: 15px;"> <b> <font face="Times New Roman" size="2"> Phone </font> </b> </div> <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0"> <xsl:for-each select="Sections/Section/Fields/Field[contains('Mobile Phone Phone2 Phone3', @Name)]"> <tr> <td width="15"></td> <td width="80" bgcolor="#C3D9FF"> <b> <font face="Times New Roman" size="2"> <xsl:choose> <xsl:when test="contains('Mobile',@Name)"> Mobile </xsl:when> <xsl:otherwise> <xsl:value-of select="../../@Name"/> </xsl:otherwise> </xsl:choose> </font> </b> </td> <td bgcolor="#E0ECFF"> <font size="3"> <a href="tel:{@Value}"> <xsl:value-of select="@Value"/> </a> </font> </td> </tr> </xsl:for-each> </table> </xsl:if> <xsl:if test="count(Sections/Section/Fields/Field[contains('Skype,ICQ,Yahoo,MSN', @Name)]) > 0"> <div style="margin-left: 15px;"> <b> <font face="Times New Roman" size="2"> IM </font> </b> </div> <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0"> <xsl:for-each select="Sections/Section/Fields/Field[contains('Skype,ICQ,Yahoo,MSN', @Name)]"> <tr> <td width="15"></td> <td width="80" bgcolor="#C3D9FF"> <b> <font face="Times New Roman" size="2"> <xsl:value-of select="@Name"/> </font> </b> </td> <td bgcolor="#E0ECFF"> <font size="3"> <xsl:choose> <xsl:when test="contains(@Name,'Skype')"> <a href="skype:{@Value}"> <xsl:value-of select="@Value"/> </a> </xsl:when> <!--More URI schemes can be found at http://en.wikipedia.org/wiki/URI_scheme. Whether a scheme work depends on the settings of the borwser your are using.--> <xsl:otherwise> <xsl:value-of select="@Value"/> </xsl:otherwise> </xsl:choose> </font> </td> </tr> </xsl:for-each> </table> </xsl:if> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>